package com.wanxi.service.impl;

import com.wanxi.dao.DesignerDao;
import com.wanxi.model.DesignerModel;
import com.wanxi.model.ResultModel;
import com.wanxi.service.DesignerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 杨金乾
 */
@Service
public class DesignerServiceImpl implements DesignerService {
    @Autowired
    DesignerDao designerDao;
    @Override
    public ResultModel enable(DesignerModel designerModel) {
        return null;
    }

    @Override
    public ResultModel add(DesignerModel designerModel) {
        return null;
    }

    @Override
    public ResultModel update(DesignerModel designerModel) {
        return ResultModel.getResult(designerDao.update(designerModel));    }

    @Override
    public ResultModel delete(DesignerModel designerModel) {
        return null;
    }

    @Override
    public ResultModel findById(DesignerModel designerModel) {
        return ResultModel.getResult(designerDao.findById(designerModel));
    }

    @Override
    public ResultModel findAll(DesignerModel designerModel) {
        designerModel.setLimit(10);
        designerModel.setPage((designerModel.getPage()-1)*10);
        return ResultModel.getResult(designerDao.findAll(designerModel), designerDao.count(designerModel));
    }

    @Override
    public ResultModel count(DesignerModel designerModel) {
        return ResultModel.getResult(designerDao.count(designerModel));
    }

    @Override
    public ResultModel isShow(DesignerModel designerModel) {
        return null;
    }

    @Override
    public ResultModel isRecommend(DesignerModel designerModel) {
        return null;
    }

    @Override
    public ResultModel whereShow(DesignerModel designerModel) {
        return null;
    }
}
